package com.heima.web;


import com.heima.service.UserService;
import org.apache.dubbo.config.annotation.Reference;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.servlet.ModelAndView;

@RestController
public class PrizeController {

    @Reference
    private UserService userService;


    @RequestMapping("/prize")
    public ModelAndView prize(ModelAndView m,String jwt){


        boolean b = userService.validateJwt(jwt);
        if(b){
            m.setViewName("redirect:/prize.jsp");
        }else {
            m.setViewName("redirect:http://localhost:8083/login");
        }
        return m;
    }

}
